<template>
  <!-- 显示经纬度 -->
  <div class="show-lon-lat">
    <div class="show-item">
      {{ transfLonAndLat(coordinate[0], "lon", true) }}
    </div>
    <div class="show-item">
      {{ transfLonAndLat(coordinate[1], "lat", true) }}
    </div>
  </div>
</template>

<script>
import { transfLonAndLat } from "@/utils/chart";
export default {
  props: {
    coordinate: {
      type: Array,
      default: () => [0, 0],
    },
  },
  data() {
    return {
      transfLonAndLat,
    };
  },
};
</script>

<style lang="scss" scoped>
.show-lon-lat {
  position: absolute;
  display: flex;
  bottom: 20px;
  left: 20px;
  z-index: 1000;
  background-color: rgba($color: #fff, $alpha: 0.7);
  padding: 3px 5px;
  border-radius: 3px;
  .show-item {
    text-align: right;
    font-size: 12px;
    color: #333;
    width: 70px;
  }
}
</style>
